home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / prog / atari / c / mail110 / mailer.h < prev    next >
C/C++ Source or Header  |  1994-02-20  |  7KB  |  213 lines

  1. #ifndef __MAIL_H
  2. #define __MAILER_H
  3.  
  4. // $Id: mailer.h,v 1.5 1994/02/20 19:15:22 gbj Exp user $
  5.  
  6. /* $Log: mailer.h,v $
  7.  * Revision 1.5  1994/02/20  19:15:22  gbj
  8.  * Updated global var comments.
  9.  *
  10.  * Revision 1.4  1994/02/20  19:12:52  gbj
  11.  * Added alias global var.
  12.  *
  13.  * Revision 1.3  1994/02/08  23:31:16  gbj
  14.  * First public release.
  15.  *
  16.  * Revision 1.2  1994/02/08  03:07:38  gbj
  17.  * Fixed Log commenting.
  18.  *
  19.  * Revision 1.1  1994/02/08  03:06:26  gbj
  20.  * Initial revision
  21.  *
  22. */
  23.  
  24. //=========================================================
  25. //
  26. //    mailer.tos
  27. //
  28. //    A simple mailer for use with NOS on the Atart ST.
  29. //
  30. //    Written by G B Judd, December 1993 (c) G B Judd 1993, 1994.
  31. //
  32. //    email:     gjudd@siward.demon.co.uk
  33. //               gjudd@cix.compulink.co.uk
  34. //
  35. //
  36. //    This program is supplied under the FSF 'Copyleft' conditions.
  37. //    See the file COPYING.FSF.
  38. //
  39. //    mailer.tos is supplied "as is" without any warranty of any kind.
  40. //    You use it ENTIRELY AT YOUR OWN RISK.  I do not accept ANY
  41. //    responsibility for its use or misuse.
  42. //    
  43. //    You can send bug reports to one, or both, of the email addresses
  44. //    above.  I cannot guarantee to respond to any bug report or
  45. //    suggestion for improvement.
  46. //
  47. //    You have the right to modify the source of this program any way
  48. //    you like bit I would appreciate you indicating what you have done,
  49. //    by whom and when in the Modification Section below.
  50. //
  51. //    I would also appreciate being informed of what you have done.
  52. //
  53. //    I shall not be responsible for any modifications carried out
  54. //    whether by me or otherwise and it is entirely my right to determine 
  55. //    whether any modification was carried out by me.
  56. //
  57. //    MODIFICATION SECTION
  58. //
  59. //  Date    Who                            Version
  60. //
  61. //    931220  G B Judd                    1.0
  62. //                Initial Version
  63. //
  64. //    940109    G B Judd                    1.1
  65. //                Fixed problems with quoting messages, bumping
  66. //                message number when reading a message, and
  67. //                scanning Reply_To:/From: for <....>
  68. //
  69. //    940112    G B Judd                    1.2
  70. //                Fixed looping problem in list.c, response
  71. //                to Continue was incorrect.
  72. //
  73. //    940112    G B Judd                    1.3
  74. //                Completely changed the processing of the From
  75. //                flag line.  Made it as simplistic as possible
  76. //                because I can't be bothered dealing with the
  77. //                various formats that it can be - will have to
  78. //                handle this properly sometime.  This means that
  79. //                it is possible that a line within the mail body
  80. //                starting 'From ' will be treated as a header.
  81. //
  82. //    940208    G B Judd                    1.4
  83. //                Fixed problem where quoted header lines which
  84. //                did not have a > in front of them were being
  85. //                treated as proper header lines in loadix.
  86. //
  87. //    940208    G B Judd                    1.5
  88. //                Changed VERSION to reflect RCS revision level
  89. //                of main.c
  90. //
  91. //    940208    G B Judd                    1.6
  92. //                Added new command '\n' which reads the next
  93. //                UNREAD message.  The mailbox index is always
  94. //                searched from 0 to maxmsgno.  If an UNREAD
  95. //                message is found, it is shown and then its
  96. //                status is changed to READ.  The current
  97. //                message pointer is updated to this message.
  98. //
  99. //    940208    G B Judd                    1.7
  100. //                First which can be released into the Public Domain.
  101. //
  102. //    940211    G B Judd                    1.8
  103. //                Enabled blinking cursor.
  104. //
  105. //    940214 G B Judd                        1.9
  106. //                Incorporated A K Jones modifications to
  107. //                maintain an outgoing mail log.
  108. //
  109. //    940220 G B Judd                        1.10
  110. //                Added mail aliasing.
  111. //=========================================================
  112.  
  113. extern char VERSION[];
  114.  
  115. #include <stddef.h>
  116. #include <stdlib.h>
  117. #include <stdio.h>
  118. #include <string.h>
  119. #include <ctype.h>
  120. #include <dos.h>
  121. #include <error.h>
  122. #include <osbind.h>
  123. #include <time.h>
  124. #include <sys/types.h>
  125. #include <sys/stat.h>
  126.  
  127. #ifndef TRUE
  128. #    define TRUE    1
  129. #endif
  130. #ifndef FALSE
  131. #    define FALSE 0
  132. #endif
  133.  
  134.  
  135. //=========================================================
  136. //    DATA STRUCTURES
  137. //=========================================================
  138.  
  139. // Runtime mailbox index
  140. typedef struct MAILIX
  141. {
  142.     int msgno;                // message number within mbox
  143.     int rflag;                // 0=not read, !0=read;
  144.     int dflag;                // 0=not marked, !0=marked for delete
  145.     char sender[128];        // Sender Id, truncated to 50 chars
  146.     char subject[128];        // Subject, truncated to 28 chars
  147.     char msgdate[13];        // dd mmm yy
  148.     char replyto[128];        // Reply-To: or From:
  149.     long fpos;                // Start byte of FLAG line for this message
  150. } MAILIX;
  151.  
  152. typedef enum COMMAND
  153. {
  154.     BAD=0, DELETE, MAIL, SAVE, WRITE, MAILFILE, REPLY, FORWARD,
  155.     UNDELETE, NEXT, PREV, PRINT, HEADER, LIST, NEW, READ, QUIT, QUITX,
  156.     HELP, UNREAD
  157. } COMMAND;
  158.  
  159. // defined in storage.c
  160. extern MAILIX mailix[];        // Runtime mailbox index
  161.  
  162. // YUK,YUK,YUK - loads of global variables...
  163. // Should be in a structure so that a pointer to it can be passed
  164. // around - may do this one day!
  165. // All defined in storage.c    
  166. extern int maxmsgno;        // Last used element in mailix[]
  167. extern char mailpath[];        // Full pathname of mail directory
  168. extern char mqueuepath[];    // Full pathname of mqueue directory
  169. extern char mbox[];            // Full pathname of current mailbox
  170. extern char sequence[];        // Full pathname of sequence file
  171. extern char txt[];            // Full pathname of .txt file
  172. extern char wrk[];            // Full pathname of .wrk file
  173. extern char tmp[];            // Full pathname of .tmp file
  174. extern char host[];            // Hostname
  175. extern char reply[];        // Reply-To:
  176. extern char name[];            // Full-name
  177. extern char edit[];            // Full pathname of your editor
  178. extern char from[];            // From:
  179. extern char user[];            // User mailbox id
  180. extern char mail[];            // Path to dir containing mail/mqueue dirs
  181. extern char sig[];            // Path to your signature file
  182. extern char log[];            // Path to your outgoing mail log
  183. extern char alias[];        // Path to your mail alias file
  184. extern FILE *mfd;            // Mailbox fd
  185. extern FILE *sfd;            // Sequence fd
  186. extern FILE *tfd;            // .txt fd
  187. extern FILE *wfd;            // .wrk fd
  188. extern FILE *xfd;            // .tmp fd
  189.  
  190. extern int cmsg;            // Current message #
  191.  
  192. //=========================================================
  193. //    PROTOTYPES
  194. //=========================================================
  195.  
  196. void main(void);
  197. void init(char *version);
  198. int loadix(char *user);
  199. void showix(int from_msg, int cur_msg);
  200. COMMAND getcmd(int *msgno, char *user, char *file);
  201. void mark(int msg, int delete);
  202. void mailto(char *user, char *file);
  203. void saveto(char *file, int header);
  204. void replyto(int msg);
  205. void forwardto(int msg, char *user);
  206. void bump(int direction);
  207. void listqueue(void);
  208. void newmbox(char *mbox);
  209. void quit(int update);
  210. void help(void);
  211.  
  212. #endif
  213.